home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / yelp / xslt / info2html.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2009-04-08  |  3.2 KB  |  118 lines

  1. <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                 xmlns:yelp="http://www.gnome.org/yelp/ns"
  5.                 xmlns="http://www.w3.org/1999/xhtml"
  6.                 extension-element-prefixes="yelp"
  7.                 version="1.0">
  8.  
  9. <xsl:param name="stylesheet_path" select="''"/>
  10.  
  11. <xsl:param name="yelp.icon.blockquote"/>
  12. <xsl:param name="yelp.icon.caution"/>
  13. <xsl:param name="yelp.icon.important"/>
  14. <xsl:param name="yelp.icon.note"/>
  15. <xsl:param name="yelp.icon.programlisting"/>
  16. <xsl:param name="yelp.icon.tip"/>
  17. <xsl:param name="yelp.icon.warning"/>
  18.  
  19. <xsl:param name="theme.color.text"/>
  20. <xsl:param name="theme.color.background"/>
  21. <xsl:param name="theme.color.text_light"/>
  22. <xsl:param name="theme.color.link"/>
  23. <xsl:param name="theme.color.link_visited"/>
  24. <xsl:param name="theme.color.gray_background"/>
  25. <xsl:param name="theme.color.gray_border"/>
  26. <xsl:param name="theme.color.blue_background"/>
  27. <xsl:param name="theme.color.blue_border"/>
  28. <xsl:param name="theme.color.red_background"/>
  29. <xsl:param name="theme.color.red_border"/>
  30. <xsl:param name="theme.color.yellow_background"/>
  31. <xsl:param name="theme.color.yellow_border"/>
  32.  
  33. <xsl:template match="/Info">
  34.   <xsl:apply-templates select="Section"/>
  35. </xsl:template>
  36.  
  37. <xsl:template match="Section">
  38.   <yelp:document href="{@id}">
  39.     <html>
  40.       <head>
  41.         <title>
  42.           <xsl:value-of select="@name"/>
  43.         </title>
  44.         <style type="text/css">
  45.           <xsl:call-template name="html.css"/>
  46.         </style>
  47.       </head>
  48.       <body>
  49.         <pre class="body">
  50.           <xsl:apply-templates select="node()[not(self::Section)]"/>
  51.         </pre>
  52.       </body>
  53.     </html>
  54.   </yelp:document>
  55.   <xsl:apply-templates select="Section"/>
  56. </xsl:template>
  57.  
  58. <xsl:template match="para">
  59.   <xsl:value-of select="node()"/>
  60.   <xsl:text>
  61.   </xsl:text>
  62. </xsl:template>
  63.  
  64. <xsl:template match="para1">
  65.   <xsl:value-of select="node()"/>
  66. </xsl:template>
  67.  
  68. <xsl:template match="spacing">
  69.   <xsl:value-of select="node()"/>
  70. </xsl:template>
  71.  
  72. <xsl:template match="a">
  73.   <xsl:element name="a">
  74.     <xsl:attribute name="href"> <xsl:value-of select="@href"/></xsl:attribute>
  75.     <xsl:value-of select="node()"/>
  76.   </xsl:element>
  77. </xsl:template>
  78.  
  79. <xsl:template match="menuholder">
  80.   <xsl:apply-templates select="node()[not(self::menuholder)]"/>
  81. </xsl:template>
  82.  
  83. <xsl:template match="noteholder">
  84.   <xsl:apply-templates select="node()[not(self::noteholder)]"/>
  85. </xsl:template>
  86.  
  87. <xsl:template name="html.css"><xsl:text>
  88. h1 { font-size: 1.6em; font-weight: bold; }
  89. h2 { font-size: 1.4em; font-weight: bold; }
  90. h3 { font-size: 1.2em; font-weight: bold; }
  91.  
  92. h1, h2, h3, h4, h5, h6, h7 { color: </xsl:text>
  93. <xsl:value-of select="$theme.color.text"/><xsl:text>; }
  94.  
  95. body { margin: 0em; padding: 0em; }
  96. pre[class~="body"] {
  97. margin-left: 0.8em;
  98. margin-right: 0.8em;
  99. margin-bottom: 1.6em;
  100. }
  101.  
  102. p, div { margin: 0em; }
  103. p + *, div + * { margin-top: 1em; }
  104.  
  105. dl { margin: 0em; }
  106. dl dd + dt { margin-top: 1em; }
  107. dl dd {
  108.   margin-top: 0.5em;
  109.   margin-left: 2em;
  110.   margin-right: 1em;
  111. }
  112. ol { margin-left: 2em; }
  113. ul { margin-left: 2em; }
  114. ul li { margin-right: 1em; }
  115. </xsl:text></xsl:template>
  116.  
  117. </xsl:stylesheet>
  118.